/*--------------------------------------------------------------------------------*/
#ifndef __MATH_VECTOR_3__
#define __MATH_VECTOR_3__
/*--------------------------------------------------------------------------------*/
#include "primitives.h"
#include "object.h"
#include "ref_to_.h"
#include "util.h"
#include "math_vector_2.h"
/*--------------------------------------------------------------------------------*/
class MATH_VECTOR_3
{

    // -- PUBLIC

public:

    // .. CONSTRUCTORS

    MATH_VECTOR_3() :
        X(0),
        Y(0),
        Z(0)
    {
    }

    MATH_VECTOR_3( const REAL & x, const REAL & y, const REAL & z ) :
        X( x ),
        Y( y ),
		Z( z )
    {
    }

    ~MATH_VECTOR_3()
	{
	}

    // .. METHODS

    VOID Set( const REAL & x, const REAL & y )
    {
        X = x;
        Y = y;
    }

    // .. OPERATORS

    MATH_VECTOR_3 & operator=( const MATH_VECTOR_3 & other )
    {
        X = other.X;
        Y = other.Y;
        Z = other.Z;

        return *this;
    }

    MATH_VECTOR_3 & operator=( const MATH_VECTOR_2 & other )
    {
        X = other.X;
        Y = other.Y;
        Z = 0;

        return *this;
    }

    MATH_VECTOR_3 & operator+=( const MATH_VECTOR_3 & other )
    {
        X += other.X;
        Y += other.Y;

        return *this;
    }

    MATH_VECTOR_3 & operator-=( const MATH_VECTOR_3 & other )
    {
        X -= other.X;
        Y -= other.Y;

        return *this;
    }

    MATH_VECTOR_3 & operator*=( const REAL & value )
    {
        X *= value;
        Y *= value;

        return *this;
    }

    MATH_VECTOR_3 & operator/=( const REAL & value )
    {
        X /= value;
        Y /= value;

        return *this;
    }

    MATH_VECTOR_3 operator+( const MATH_VECTOR_3 & other )
    {
        return MATH_VECTOR_3( X + other.X, Y + other.Y, 0 );
    }

    MATH_VECTOR_3 operator-( const MATH_VECTOR_3 & other )
    {
        return MATH_VECTOR_3( X - other.X, Y - other.Y, 0 );
    }

    const MATH_VECTOR_3 operator*( const REAL & real ) const
    {
        return MATH_VECTOR_3( X * real, Y * real, 0 );
    }

    MATH_VECTOR_3 operator/( const REAL & real )
    {
        return MATH_VECTOR_3( X / real, Y / real, 0 );
    }

    // .. ATTRIBUTES

    REAL
		X,
		Y,
		Z;

    static MATH_VECTOR_3
		Zero;

};
/*--------------------------------------------------------------------------------*/

/*--------------------------------------------------------------------------------*/
#endif


